﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace PageAdmin.Utils.ORM
{
    /// <summary>
    /// 树形表模型集成的基类
    /// </summary>
    public abstract class MultipleLevelModelBase<T> where T:class,new()
    {
        public virtual int Id { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>
        public virtual int ParentId { get; set; }

        /// <summary>
        /// 子级
        /// </summary>
        public virtual IEnumerable<T> children { get; set; }

        [NotMapped]
        /// <summary>
        /// 子级
        /// </summary>
        public virtual bool hasChildren { get; set; }

    }
}
